<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/css/H-ui.login.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />

<title>聚生财后台管理后台登录 - V1.0</title>
<meta name="keywords" content="H-ui.admin v2.3,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description" content="H-ui.admin v2.3，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<!-- <div class="header">
</div> -->
<div class="loginWraper">
  <div class="loginBox">
    <form   class="form form-horizontal" method="post"  id="from1" >
      <div class="row cl">
        <label class="form-label col-3"><i class="Hui-iconfont">&#xe60d;</i></label>
        <div class="formControls col-5">
          <input id="userName" name="userName" type="text" placeholder="账户" class="input-text size-L" size="15" datatype="*6-11" nullmsg="用户名不能为空">
        </div>
      </div>
      <div class="row cl">
        <label class="form-label col-3"><i class="Hui-iconfont">&#xe60e;</i></label>
        <div class="formControls col-8 skin-minimal">
          <input id="passWord" name="passWord" type="password" placeholder="密码" class="input-text size-L" datatype="*6-8" nullmsg="密码不能为空" >
        </div>
      </div>
      <div class="row cl">
        <!-- <div class="formControls col-8 col-offset-3">
          <input class="input-text size-L" type="text" placeholder="验证码" onblur="if(this.value==''){this.value='验证码:'}" onclick="if(this.value=='验证码:'){this.value='';}" value="验证码:" style="width:150px;">
          <img src="images/VerifyCode.aspx.png"> <a id="kanbuq" href="javascript:;">看不清，换一张</a> </div> -->
      </div>
      <div class="row">
        <div id="msgerror" class="formControls col-8 col-offset-3" ></div>
        <div  class="formControls col-8 col-offset-3" ></div>
      </div> 
      <div class="row">
        <div class="formControls col-8 col-offset-3">
          <input  type="submit" class="btn btn-success radius size-L" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">&nbsp;&nbsp;
          <input  type="reset" class="btn btn-default radius size-L" value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;">
        </div>
      </div>
    </form>
  </div>
</div>
<div class="footer">Copyright 浙江万古资产管理有限公司 by H-ui.admin.v2.3</div>

<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/Validform/5.3.2/Validform.min.js"></script> 
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/lib/layer/2.1/layer.js"></script> 

<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/js/H-ui.js"></script> 
<script type="text/javascript" src="<%=basePath%>plugins/h_uiadmin_v2.3.4/js/H-ui.admin.js"></script> 
 <script type="text/javascript" src="<%=basePath%>common/js/cms.js"></script>

<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#from1").Validform({
		tiptype:function(msg,o,cssctl){
			/* var objtip=$("#msgerror");
			cssctl(objtip,o.type);
			objtip.text(msg); */
			//alert(msg) ;
			// if(msg !=null || msg !=undefined || msg.length !=''  || msg.length > 0 ){
			if(msg.length > 0){
				// console.log(msg) ;
				 layer.msg(msg,{icon:2,time:1000});
			}
		} ,
		beforeSubmit:function(form){
			 //在验证成功后，表单提交前执行的函数，curform参数是当前表单对象。
           //这里明确return false的话表单将不会提交;
			submitForm(form) ;
			return false ;
		},
		callback:function(form){
			return false ;
		} 
	});
	
	function submitForm(form ){
		var params = JSON.stringify( $("#from1").serializeJson()) ;
		$.ajax({
			"type": "POST", 
			"url": "<%=basePath%>console/dologin"  , 
		   // "contentType":"application/json;charset=UTF-8",   
			"dataType": "json",  // 预期服务器返回的数据类型
			"data":  $("#from1").serialize() ,      
			"success": function(resp) {
				 // console.log(resp) ;
				 
				if(resp.success){
					  window.location.href="<%=basePath%>console/main";
				}else{
					 
					/* layer.alert( resp.errMsg+",请重试!", {icon: 2},function(index){
						 layer.close(index);
					  }); */
					layer.msg(resp.errMsg+",请重试!",{icon:2,time:1000});
				}
				 
			}
		}); 
	}
	
});
</script>
</body>
</html>